<template>
<div>
  <el-table
      :data="dict"
      stripe
      style="width: 100%;height:100%">
    <el-table-column
        prop="name"
        label="借款名称">
    </el-table-column>
    <el-table-column
        prop="total_money"
        label="姓名"
        >
    </el-table-column>
    <el-table-column
        prop="need_money"
        label="已筹资金"
        >
    </el-table-column>
    <el-table-column
        prop="status"
        label="满标">
    </el-table-column>
    <el-table-column
        prop="repay_time"
        label="还款期限(月)">
    </el-table-column>
      <el-table-column
        prop="use1"
        label="借款用途	">
    </el-table-column>
    <el-table-column
        prop="interest_rate"
        label="利息">
    </el-table-column>
    <el-table-column fixed="right" label="操作" width="120">
      <template  v-slot="scope">
        <el-button type="text" size="small" @click="handleClick(scope.row.id)"
        >通过</el-button
        >
        <el-button type="text" size="small" @click="refuse(scope.row.id)">拒绝</el-button>
        <el-button type="text" size="small" @click="Order_details(scope.row.id)">查看详情</el-button>
      </template>
    </el-table-column>
  </el-table>
</div>
</template>

<script>
export default {
name: "full_bid",
  data(){
    return{
      dict:[]
    }
  },
  methods:{
  // 查看订单详情
    Order_details(id){
    console.log(id)
    },
    // 表单审核通过
    handleClick(row) {
      this.$confirm('确定审核通过及放款, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '通过成功!'
        });
        this.myaxios('http://localhost:5000/markaudit','get',{
          'markid':row,
          'status':4
        }).then(res=>{
          console.log(res)

        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消通过'
        });
      });
    },
    // 表单审核拒绝
    refuse(row){
      this.$confirm('确定审核拒绝, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '拒绝成功!'
        });
        this.myaxios('http://localhost:5000/markaudit','get',{
          'markid':row,
          'status':5
        }).then(res=>{
          console.log(res)

        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消通过'
        });
      });
    },
    get_marklist(){
      this.myaxios('http://localhost:5000/get_marklist','get',{'nuid':3}).then(res=>{
        console.log(res)
        this.dict=res.list

      })
    },
  },
  mounted() {
  this.get_marklist()
  }
}
</script>

<style scoped>

</style>
